Skip to content

fix(web): repair what the pre-release sweep found - #73

Merged
enricobuehler merged 48 commits into
mainfrom
fix/web-sweep
Nov 5, 2026
Merged

enricobuehler merged 48 commits into
mainfrom
fix/web-sweep

Conversation

@enricobuehler

Copy link
Copy Markdown
Member

A full sweep of the browser client before the release: six reviewers, one per area, each finding checked against the code before it was fixed. One commit per finding.

Fixed

Page shell

  • A dropped stream is decided from the engine's own edge. The heading no longer flips, a Settings dialog over the stream closes when it ends, and the exit hint stops with the stream.
  • A link's fingerprint now holds across Retry, the reconnect after pairing, and forget-and-pair-again.
  • A 429 on config.json is said, and the list is read again later. The page's server stays the route.
  • A mistyped address keeps its sentence through redraws.
  • The End game notice clears on the next stream, and a late answer for another shelf is dropped.
  • After a version mismatch, the library is read again.
  • The sidebar leaves the profile gate.
  • Side insets clear a notch in landscape.
  • "Sound is off until you click or press a key." shows while Web Audio waits for a gesture.
  • A stream start no longer resizes the console's canvas, which blanked one frame.

Console mode

  • A launch hold that ends short of the stream keeps the web shell out.
  • The page's Settings sheet shows over a console stream instead of a black page.
  • A failed or abandoned connect no longer leaves a launch, PIN or knock queued for the next visit.
  • Hosts behind the page's server without a plane get rows of their own.
  • A refused wake takes the wake card down.
  • The cover scratch canvas is cleared before each cover.
  • A TV's text fields open the full keyboard.

Engine and connection

  • Only a 401 sign-in refusal reads as "pair again". A 429 or a host blip is no longer forgotten.
  • The page's own server is never read as a certificate to accept.
  • A bridge that never opened names the page's server, not UDP 9778.
  • A device key from an older connect is ignored.
  • A pass the server refused is asked for again before a bridge dial. Otherwise a paired browser lands in the pairing pool and is cut at 3 minutes.
  • A bridge whose pongs stop (10 unanswered pings) ends as a lost connection.

Media and input

  • A held key is released wherever its keyup lands: the menu, a field, a chord, or Cmd on macOS.
  • Mouse capture holds outside pointer lock.
  • Pads go to rest on blur or a hidden tab.
  • Mic:
    • An overtaken mic start closes its own capture.
    • Capture runs at the device rate, resampled to 48 kHz, for Firefox.
    • On an iPhone the audio session is playback, and play-and-record while the mic is on.
  • A lost WebGL2 or WebGPU context is rebuilt.
  • HDR is offered only to a canvas that can show it.
  • The keyboard lock is dropped when a stream ends.
  • The cursor is set only when it changes.

Wasm core (Automatic bitrate inputs, matching native)

  • A full ring that a drain emptied is not a socket drop.
  • PipelineGap discards the window it covers.
  • The page's own keyframe asks count as starved, not as loss.

Server, CI, deploy

  • A connection silent for 60 s is closed, and a token-less body must arrive within 10 s.
  • An attested plane expiry is capped at 14 days, where u64::MAX panicked.
  • At most 64 hosts are held from mDNS.
  • The Tailscale sidecar runs on kernel networking, so the server reaches the tailnet.
  • The nginx advice is Host $http_host.
  • CI:
    • Images are pushed by digest, and manifest combines only this run's.
    • :edge moves only for main's head, and :latest never for a prerelease.
    • The GitHub release waits for every check.

Not done

  • Home prefix: widening it from /64 to /56 for multi-prefix homes widens a trust boundary. It needs the maintainer's decision.
  • :latest on an old server: compose.public.yaml pulls :latest, which today is v0.3.3, without the new rules. The release cut that follows moves it.
  • Release notes: a router name outside .local/.home.arpa/.internal needs TLS_NAMES, and wake needs a pass from a login in the last 30 days. Both go in the notes.
  • Narrow windows: a WebGL context lost between streams comes back only for the stream after its restore. A stale device-key callback can still land during the newer connect's own key load.

Checks

  • npm run check, npm test (106 stream + 10 web).
  • cargo fmt --check, cargo test (25) in packages/stream.
  • cargo fmt --check, clippy -D warnings, cargo test --locked (49) in server/.
  • The digest push to git.unom.io is proved by the first main run after merge.

On-glass owed: a stream on Chrome, Firefox and Safari; console mode on a TV; the mic on Firefox and iPhone; a bridge stream through a pass renewal.

A full ring used to count a drop at the first refused claim, but the
feed then drains the ring and stores the datagram. The phantom drop
reached the bitrate driver as this receiver's own loss, which marks the
window a link fault and can cut the rate with nothing lost.

The claim now only refuses. The feed reports a datagram it really gives
up through pf_rx_lost: one the drained ring still cannot take, or one
longer than a slot.
The host announces each capture and encoder rebuild with PipelineGap: a
resize, a source mode change, a capture recovery. The page skipped the
message, so the bitrate driver judged the window in flight as the link
with no frames, old-epoch drops and a keyframe ask, and could cut the
rate for a stall on the host.

The page now hands the newest gap to the next tick, which discards that
window as the native pump does.
The bitrate driver cuts on keyframe asks a loss stands behind, and two
in one window are enough. The page counted every ask that way,
including a decoder error streak and the hold a rebuilt decoder raises,
with the hold's half-second re-asks. Nothing was lost there, and a lower
rate cannot feed a struggling decoder.

The hold now remembers whether the page raised it on an open gate, the
rule core's RecoveryDriver applies. Those asks reach the driver as
starved asks. A loss that re-arms the hold makes it the loss's again,
and a rebuilt decoder's ask, which the page did not count before, is
counted by the same rule.
A launch hold that ended short of the stream (B before the dial
landed, a failed start, a stream that closed under the hold) handed
the web shell the raw screen. Home, the library or an error card then
covered the console as an opaque page while the pad drove the console
underneath, until the next render.

The hold's end now goes through the same filter as every render: the
web shell draws only its own sheets.
The sidebar on the accept, trust and link sheets and the stream
overlay both open the page's settings. Console mode drew nothing for
that screen and left settingsOpen set, so every later screen read as
settings. Opened over a stream, the end of that stream never reached
the console: a hidden canvas over an empty page until a reload.

The sheet is now one of the web shell's screens, closed by its own
Done, Back or sidebar. The console follows the flow around it, so a
stream that ends while the sheet is open still ends there.
A Launch, Pair or RequestAccess for a host not yet reached waits for
that host to come up. When the connect failed, or was backed out on
the page's accept or trust sheet, the step stayed. The next visit to
that host's library started the old stream unasked, sent an old PIN,
or knocked again.

An error or a return home now drops them, as Back on the console
already does. In console mode the page shows home only with the
engine on no host, so no flow passes through it mid-way.
A visitor without a pass gets the page server's hosts without their
plane address. Every such row then took the page's own hostname as its
address and key, so the console's commands for any of them reached the
last one listed.

A row behind the page's server with no plane is now addressed by its
route, which no two hosts share. Rows with a plane, and hosts dialled
directly, keep their address. The row helpers move out of ConsoleUi so
a test can pin this without a browser.
A wake the page's server refused, or one it never sent, came out as a
toast while the console's wake card went on counting to a minute and
then said the host never came back.

The wake action now resolves whether a packet went out, and the
console takes its card down when none did. A sent wake that the host
does not answer still ends on the card's own timeout, which offers to
try again.
Every cover and profile picture is drawn onto one shared canvas that
keeps the last image. A picture with transparent areas showed the
previous cover through them.
Every field that did not take digits asked the set for the decimal
pad: a number pad with a dot. The device name on the pair screen, the
library's search and a host's name take letters.

Digit fields keep the number pad. Every other field gets the full
keyboard, which types the dot of an address too.
A key the host holds was let go only when its keyup reached the picture.
Opening the quick menu with its chord moves focus into the menu before
Ctrl, Alt and Shift come up, so their keyups were kept local and the host
held all three. A held S, D, O, Q, V, M or Enter released under the chord
modifiers matched a chord and was dropped the same way.

macOS sends no keyup for a key pressed while Cmd is down, so Cmd+C left C
held and repeating on the host. Keys that go down under Meta are now let
go when Meta comes up; keys held from before it stay down.
In absolute mode a drag released over the HUD toolbar, which appears on
any pointer move, or over another overlay never reached the canvas. The
host kept the button down until the pointer came back over the picture,
then moved the drag to the re-entry point before letting go.
Pads are read once a frame, and a hidden tab runs no frames, so a stick or
trigger held as the tab hid stayed applied on the host until it came back.
A lost focus now sends every attached pad at rest, and a hidden tab counts
as a lost focus. A window that blurs but keeps drawing sends the real pad
again on the next frame, which differs from the rest state just sent.
Turning the microphone on, off and on again while the first permission
prompt was up let both prompts proceed. The second overwrote the first's
stream and context, and the first returned without stopping either, so a
capture stayed open, recording indicator and all, until the page closed.

Every start and stop now moves a generation, and a start that finds it
moved after an await stops its own tracks and closes its own context.
The microphone's context was forced to 48 kHz. Firefox refuses to connect
a capture to a context at another rate, so on an output device at 44.1 kHz
the microphone went back to Off with only a console error.

The context now runs at the device's rate, and the capture worklet brings
it to the 48 kHz the encoder and the host expect when the two differ.
Safari plays Web Audio in the ambient category unless the page says
otherwise, and the ring/silent switch mutes that, so a stream on an
iPhone set to silent had no sound. The audio pipe now declares playback
where the browser offers an audio session.
Nothing claimed a lost WebGL2 context, so the browser never restored it.
The canvas then handed the same dead context to every later plane, the
plane could not be built, and each stream after it showed black with
sound and input until a reload. A lost WebGPU device froze the picture
for the rest of its stream.

The WebGL2 plane now claims the loss and, once the context is back, the
pipe builds a new plane and decoder for the last configuration; a WebGPU
device lost other than by destroy does the same. A plane that cannot be
made counts as a decode error instead of an unhandled rejection.
A canvas keeps the first kind of context it hands out. After a stream on
WebGL2, switching the backend to Auto or WebGPU without a reload still
offered HDR, but the next plane landed on WebGL2 again, which shows the
PQ signal unconverted: a washed-out picture for the whole stream.

The offer now reads the backend the canvas holds once a plane was made
on it, and the preference only before that.
Fullscreen during a stream locks the keyboard so system shortcuts reach
the host. The lock was only released by leaving fullscreen through the
engine, so a stream that ended while the player stayed fullscreen left
the library holding Alt+Tab and the Windows key, and a short Esc no
longer left fullscreen.

The lock now ends with the session, and a stream that starts while the
page is already fullscreen takes it again.
The cursor was compared against the canvas's own style value, which the
browser serializes with the URL in quotes, so the host's bitmap never
matched and its data URL was parsed and set again on every frame. The
compare is now against the last string this set.
The loss was claimed only while a plane was alive, so a context lost
between two streams was never restored, and every later stream on that
canvas stayed black until a reload. The first WebGL2 plane on a canvas
now claims its losses for good, and a stream that starts after the
restore draws again.
The audio pipe now declares Safari's session as playback, which does not
record. While the microphone captures, the session is play-and-record;
stopping the microphone gives playback back, unless something else has
changed the session since.
A denied microphone left Safari's audio session in play-and-record until the stream ended.
A stranger over the server's meter got a 429 for config.json, which
did not parse, so the page read it as no server at all: the listed
hosts vanished without a word, and a typed address was dialled
directly for the rest of the visit.

A 429 now means the page's own server is there. The page says the
rate-limit sentence, keeps routing typed addresses through the server,
and asks for the list again on a later redraw of the hosts.
A link pins its host to a fingerprint, but only its first connect
carried the pin. In a fresh browser that connect stops at the
certificate, so "I have accepted it" reconnected with no pin and the
link's host was trusted on first use.

The pin now stays with that host until the page is idle again, and
every reconnect to it carries the pin: a retry, the connection after
pairing, and forget-and-pair-again.
Whether an error was a stream that dropped was read off the screen on
display. A redraw of the same error found the error screen there, so
the exit hint's timer turned "The stream stopped" into "Something went
wrong". With Settings open over the stream, the screen was the
dialog: the drop stayed hidden behind the Settings page, and leaving
it through the sidebar disconnected the error unseen.

The drop is now decided on the engine's edge out of a live or
starting stream, which also closes a settings dialog over it, and the
hint's timer stops when the stream ends.
The sentence for an address that is not one went to the host list
once. The reachability probe it started redraws the list on every
answer, without it, so with known hosts on the page the sentence went
within milliseconds.

The list now takes it from the engine, which holds the mistyped
address until the next connect.
"Ended Hades." stayed on the shelf for the rest of the visit, beside
"Running now: Hades" once the game was played again. An answer that
landed after another shelf opened wrote its notice there and cleared
that shelf's running title.

The notice now lasts until the next stream, and an answer for a shelf
no longer open is dropped.
A library read that failed on a version mismatch still stamped the
library's clock, so Back then Connect within a minute skipped the
read and showed "This host's library is empty" instead of the
mismatch.

Only a read that succeeds sets the clock now. Any failure clears it,
so opening the host again asks again.
The profile picker, the seat wait and their error sit on a host that
is ready, which the sidebar does not cancel. Hosts or Library marked
the tab but left the page where it was, and the seat wait still
started the stream later.

The sidebar now drops the gate as it drops any other flow, which also
ends the seat wait's poll.
The page is viewport-fit=cover, so in a phone's landscape it draws
under the notch, but only the phone tab bar padded for the safe area.
The sidebar rail, the page's right edge, a statistics card in a side
corner and the toasts could sit under the camera housing.

Each now keeps at least the safe-area inset from its side edge.
A browser starts audio only after a click or a key, and a controller
press is neither, so a player on a pad heard nothing and saw nothing
say why.

While the audio context stays suspended over a live picture, the HUD
says sound is off until a click or a key.
The SDK throws the same refusal for every status the device sign-in
answers with, and the engine took each one as an unpairing. A 429 from
the page server's stranger meter, or a 502/504 while the host blips,
put the player on "pair again", and pairing from there dropped a good
pin.

Only a 401 means the host no longer knows this device. Too many
requests is an error with its own sentence; any other status fails the
sign-in like other management-API failures, which leaves streaming
possible.
A host reached through the page's server shares the page's origin, so
its certificate is already accepted. The probe still read every refusal
other than 429/502/503/504, and every fast failure, as a certificate
the player had to accept. A typed public IP (400), a host the operator
took off the list (404), or the server being down showed the "Accept
this host's certificate" sheet for the page's own server, and the
server's sentence was lost.

On the page's own origin a refusal is now unreachable with the
server's plain-text sentence, and a failed fetch is unreachable. Hosts
reached directly keep the timing rule.
A dial through the page server's bridge that failed before it opened
told the player to check UDP on the host's streaming port, and a
WebSocket the browser would not build reported a refused WebTransport
session. Neither carrier was involved. A visitor outside the network
has only the bridge, so a refused upgrade (the stranger meter, a host
the server cannot reach, a proxy that drops WebSockets) sent them to
check a path they never use.

The sentence now follows the carrier that failed.
The device key loads asynchronously and its callbacks carry no sign of
which connect asked for them. A connect that began while an earlier
one's key was still coming out of IndexedDB took that key as its own:
it signed in to the newer host, or showed it as needing pairing, before
reaching it, reading its plane or checking its attestation, and its own
steps then overwrote the state.

Each key request now records the connect it belongs to, and a callback
that arrives after a newer connect began is ignored.
A pass renewal that failed once, a 429 while the browser still counts
as a stranger or a host that did not answer, was never asked for again
for that token, which lives about an hour. A bridge dial in that time
showed no pass, and the server put the paired device in the pairing
pool, which ends every session at three minutes and allows one per
address.

The token now counts as renewed only once a pass is held, so the next
management call asks again. A dial for a paired host that the held pass
does not cover renews once before it goes out.
A TCP leg that dies without a reset gives the browser no error, so the
bridge kept reporting a live stream with a frozen picture until the
operating system gave up on the socket, often minutes. WebTransport
ends on its idle timeout instead.

The carrier already pings every second. After the first pong, ten pings
in a row without an answer end the session as a lost connection. They
are counted, not timed, so a background tab whose timer slows down
never trips it.
The stream's size was measured off the UI canvas, and the measure also
wrote that size, rounded down to even, onto the canvas's buffer. The
console sizes the same buffer to the window, so at an odd window size
every stream start cleared the frame the launch hold had just drawn:
one blank frame.

Nothing else draws on that canvas: the web shell is DOM, and only the
console brings up a context there. The measure now only measures.
The renewal before a bridge dial resumed only a stream start, so a PIN or an access request to a paired host without a pass never dialled. A failed sign-in also stops naming the HTTP status, which a player cannot act on.
After TLS, the listener's only timer was hyper's header timeout, which
starts once the first bytes arrive. A peer that sent nothing, an HTTP/2
connection left open, or a request whose body stopped arriving held its
slot forever: eight addresses, or one IPv6 /56, filled all 256 and every
other visitor was dropped at accept.

A connection now closes after 30 s with no byte moving either way. A live
bridge pings far more often. A body without a token must arrive within
10 s.
The attestation signs the plane's hash, not its expires_at. A device that
attests itself at a typed or announced address could answer u64::MAX, and
adding that to an Instant panicked the request that proved it. A browser
pins a plane certificate for two weeks at most, so nothing later is worth
believing.
An advert is believed as sent, so a device on the LAN could announce any
number of names, each with a mac entry. Every one joined the host list
that config.json hands out, and its MACs went into wake.json, rewritten
whole each time. A host with MACs is kept after its advert goes, so the
list never shrank.

Past 64, a new name is refused and keeps no MACs. Hosts already held stay
and still move. Nothing expires: a host asleep for weeks still wakes.
The Tailscale image runs userspace networking unless told otherwise. The
page server shares the sidecar's network namespace and dials the hosts'
tailnet addresses itself, which only kernel networking routes: every
relayed request timed out and the bridge could not dial. The TUN device
and NET_ADMIN were already granted for it.
nginx's $host drops the port. On a public port other than 443 the page's
Origin keeps it, so every POST and every bridge WebSocket failed the
same-origin check with 403. $http_host passes the header as the browser
sent it.

The README's line on the bridge behind a proxy also said it sees only the
proxy's address. It reads X-Forwarded-For now, so the line asks for it.
Each run pushed shared per-architecture tags, and manifest combined
whatever they held when it ran. Two merges minutes apart published the
older commit over the newer as edge, and one could mix both commits
across architectures. Each image now goes up by digest, the manifest
names this run's two, and edge moves only while the commit is still
main's head.

A prerelease tag no longer moves latest. The GitHub release waits for
every check, as the image already did, instead of only the build.
On HTTP/2 a read is always pending, so the idle close also cut a host reply slower than 30 s. 60 s matches nginx's read timeout and still frees a slot an open-and-forget peer holds.
@enricobuehler
enricobuehler merged commit 366e707 into main Nov 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant